<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head id="MyHead">
    <script src="../resources/script/jquery.min.js" type="text/javascript"></script>
    <script src="../resources/Script/JScriptIndex.js" type="text/javascript"></script>
    <script src="../resources/script/jquery.easyui.min.js" type="text/javascript"></script>
    <link href="../resources/Content/Default.css" rel="stylesheet" type="text/css" />
    <link href="../resources/Content/IndexStyle.css" rel="stylesheet" type="text/css" />
    <link href="../resources/css/themes/icon.css" rel="stylesheet" type="text/css" />
    <script src="../resources/script/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <link href="../resources/css/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <title>
	

</title>
     <script type="text/javascript" language="javascript">


        $(function () {
             $.extend($.fn.datagrid.methods, {
                 addToolbarItem: function (jq, items) {
                     return jq.each(function () {
                         var dpanel = $(this).datagrid('getPanel');
                         var toolbar = dpanel.children("div.datagrid-toolbar");
                         if (!toolbar.length) {
                             toolbar = $("<div class=\"datagrid-toolbar\"><table cellspacing=\"0\" cellpadding=\"0\"><tr></tr></table></div>").prependTo(dpanel);
                             $(this).datagrid('resize');
                         }
                         var tr = toolbar.find("tr");
                         for (var i = 0; i < items.length; i++) {
                             var btn = items[i];
                             if (btn == "-") {
                                 $("<td><div class=\"datagrid-btn-separator\"></div></td>").appendTo(tr);
                             } else {
                                 var td = $("<td></td>").appendTo(tr);
                                 var b = $("<a href=\"javascript:void(0)\"></a>").appendTo(td);
                                 b[0].onclick = eval(btn.handler || function () { });
                                 b.linkbutton($.extend({}, btn, {
                                     plain: true
                                 }));
                             }
                         }
                     });
                 },
                 removeToolbarItem: function (jq, param) {
                     return jq.each(function () {
                         var dpanel = $(this).datagrid('getPanel');
                         var toolbar = dpanel.children("div.datagrid-toolbar");
                         var cbtn = null;
                         if (typeof param == "number") {
                             cbtn = toolbar.find("td").eq(param).find('span.l-btn-text');
                         } else if (typeof param == "string") {
                             cbtn = toolbar.find("span.l-btn-text:contains('" + param + "')");
                         }
                         if (cbtn && cbtn.length > 0) {
                             cbtn.closest('td').remove();
                             cbtn = null;
                         }
                     });
                 }
             });
         });
    </script>
    
    
<script type="text/javascript" language="javascript">
 $(function () {
 $("#yesfendianID").combobox({ panelHeight: 'auto', editable: false });
            $("#yesfenxiaoID").combobox({
                editable: false,
                onSelect: function (record) {

                    $.ajax({
                        type: "POST",
                        url: '../../SysPerson/getSelData/?table=StudentSource&colum=models&pid=' + record.value,
                        dataType: 'json',
                        success: function (jsonstr) {
                            // 修改ajax返回的值
                            jsonstr.push({
                                'id': '',
                                'text': '全部',
                                "selected": true
                            });
                            $("#yesfendianID").combobox({ data: jsonstr, panelHeight: 'auto', editable: true, valueField: 'id', textField: 'text' });
                        }
                    });
                }
            });
            $("#nofendianID").combobox({ panelHeight: 'auto', editable: false });
            $("#nofenxiaoID").combobox({
                editable: false,
                onSelect: function (record) {

                    $.ajax({
                        type: "POST",
                        url: '../../SysPerson/getSelData/?table=StudentSource&colum=models&pid=' + record.value,
                        dataType: 'json',
                        success: function (jsonstr) {
                            // 修改ajax返回的值
                            jsonstr.push({
                                'id': '',
                                'text': '全部',
                                "selected": true
                            });
                            $("#nofendianID").combobox({ data: jsonstr, panelHeight: 'auto', editable: true, valueField: 'id', textField: 'text' });
                        }
                    });
                }
            });
            stuList("yesflexigridData");
            setTimeout(function () { stuList("noflexigridData"); }, 1000); //不符合条件
            setTimeout(function () { empList();getYtjshumu(); }, 1000);
            
        });
    function stuList(obj){
    var toolbar=[];
    var search="";
    //符合条件
    if(obj=="yesflexigridData")
    {
    search='S_Sub1BaoKaoStart_Int&0^S_Sub1BaoKaoEnd_Int&2^S_ZhiDuiShouLiStart_Int&1^S_ZhiDuiShouLiEnd_Int&1^S_FinanAuditStart_Int&0^S_FinanAuditEnd_Int&0^S_SubjectAhours&2013052917005326562506357515b2e^FK_DIC_Start&noway^||201301301444110156250c451035ec5$$yes'
    toolbar="#yesSearch2";
  
    }
    //不符合条件
    if(obj=="noflexigridData"){
    search='S_Sub1BaoKaoStart_Int&0^S_Sub1BaoKaoEnd_Int&2^FK_DIC_Start&noway^||201301301444110156250c451035ec5$$no'
    toolbar="#noSearch";
//    toolbar=[
//                       {
//                           text: '查询',
//                           iconCls: 'icon-search',
//                           handler: function () {
//                               flexiQuery();
//                           }
//                       }
//                       , {
//                           text: '档案',
//                           iconCls: 'icon-ok',
//                           handler: function () {
//                               return flexiArchives();
//                           }
//                       }
//                       ];
    }




                $('#' + obj).datagrid({
                //title: '学员列表', //列表的标题
                iconCls: 'icon-site',
                width: 'auto',
                height: 'auto',
                nowrap: true,
                striped: true,
                collapsible: true,
                url: '../../../S_Student/GetData', //获取数据的url
                queryParams: { search: search},
                sortName: 'PK_ID',
                sortOrder: 'desc',
                idField: 'PK_ID',

                toolbar: toolbar,
                columns: [[

                    { field: 'ck', checkbox: true },
					{ field: 'S_NO', title: '<label for="S_NO">学员编号</label>', width: 70 ,sortable: true}
                    //,{ field: 'S_ArNO', title: '<label for="S_ArNO">档案编号</label>', width: 60 ,sortable: true}
                    ,{ field: 'S_name', title: '<label for="S_name">姓名</label>', width: 60 ,sortable: true}
                    , { field: 'S_cardno', title: '<label for="S_cardno">身份证号</label>', width: 135 ,sortable: true}
                    , { field: 'S_mob', title: '<label for="S_mob">手机</label>', width: 80 ,sortable: true}
                    , { field: 'S_Carmodels', title: '<label for="S_Carmodels">准驾车型</label>', width: 60 ,sortable: true}
                    , { field: 'FK_Carid', title: '<label for="FK_Carid">班别</label>', width: 60 ,sortable: true}
					, { field: 'S_Sub1State', title: '科一状态', width: 60 ,sortable: true}
                    , { field: 'S_Sub1Time', title:  '科一考试时间', width: 80 ,sortable: true
                    }
                    , { field: 'cishu', title: '次数', width: 30 ,sortable: true}
					, { field: 'S_PhysicalDate', title: '<label for="S_PhysicalDate">体检日期</label>', width: 75 
                    ,sortable: true
                    }

                    //                    , { field: 'FK_Carid', title: '<label for="FK_CaridOld">班别</label>', width: 60 ,sortable: true}
                    
                    , { field: 'FK_DIC_from', title: '<label for="FK_DIC_from">报名分校</label>', width: 60 ,sortable: true}

                    , { field: 'S_regdate', title: '<label for="S_regdate">报名日期</label>', width: 75
                    , formatter: function (value, rec) {
                        if (value) {
                            return dateConvert(value);
                        }
                    },sortable: true
					}
                     
					, { field: 'S_Remark', title: '<label for="S_Remark">备注</label>', width: 80 ,sortable: true}
                ]],
                pagination: true,
                pageList:[50,200,1000],
                rownumbers: true

            });
    }

            //获取已报考计划数，备用数
        function getYtjshumu() {
            $.post("../../T_apply/getYbkNum1", { ksid: '2018011915500544030930c5add34d5' }, function (res) {
                //alert($("#jihua1").text());
                $("#cgshu").text(res["cgshu"]);//成功数
                $("#sbshu").text(res["sbshu"]);//失败数
                $("#ybkshu").text(res["ybkshu"]);//已报考数
                $("#dbkshu").text(res["dbkshu"]);//待报考数
                $("#cjshu").text(res["cjshu"]);//参加数
                $("#qkshu").text(res["qkshu"]);//缺考数
                $("#hgshu").text(res["hgshu"]);//合格数
                $("#bhgshu").text(res["bhgshu"]);//不合格数

                //$("#jhshu").text(res["jhshu"]);//计划数
                //$("#byshu").text(res["byshu"]);//备用数

                $("#yzcshu").text(res["yzcshu"]);//已支出
                $("#wzcshu").text(res["wzcshu"]);//未支出
                $("#dzcshu").text(res["dzcshu"]);//待支出

            });
        }

    function empList(){
                        $('#empList').datagrid({
                //title: '员工', //列表的标题
                iconCls: 'icon-site',
                width: 'auto',
                height: 'auto',
                nowrap: true,
                striped: true,
                singleSelect:true,
                collapsible: true,
                url: '../../S_Employees/GetData', //获取数据的url
                queryParams: {           
                search: 'zubieID&2014032215264490297860757751092^'
                 
                  },
                sortName: 'PK_ID',
                sortOrder: 'desc',
                idField: 'PK_ID',
                columns: [[
                   
                    
					{ field: 'MyNO', title: '教练编号', width: 80 ,sortable: true}
					,{ field: 'MyName', title:  '教练姓名', width: 80 ,sortable: true}
					,{ field: 'MobilePhoneNumber', title:  '手机号码', width: 100 ,sortable: true}
					, { field: 'DrivingType', title: '准驾车型', width: 100 ,sortable: true}
				
                ]],
                pagination: true,
                rownumbers: true

            });
    }


    function FindData2() {
            var search = "zubieID&2014032215264490297860757751092^";
            var keyword = $("#keyword").val();

            if (keyword != "") {
                search += "MyName&" + keyword + "^"
            }
            //执行查询
            //alert(search);
            $('#empList').datagrid('reload', { search: search });
        }

 
        //“查询”按钮，弹出查询框
        function flexiQuery() {
            $('#divQuery').dialog({
                buttons: [{
                    text: '查询',
                    iconCls: 'icon-ok',
                    handler: function () {
                        //将查询条件按照分隔符拼接成字符串
                        var search = "";
                        var FK_TSIDTree="";
                        var TA_statusVal="";
                        var TA_statusTwoVal="";
                        var FK_TSIDTreeTwo="";
                        $('#divQuery').find(":text,:selected,select,textarea,:hidden,:checked,:password").each(function () {
                            search = search + this.id + "&" + this.value + "^";
                            if(this.id=="TA_status"){
                            TA_statusVal=this.value;
                            }
                                if(this.id=="TA_statusTwo"){
                            TA_statusTwoVal=this.value;
                            }
                        });
                        //alert(search);
                        //执行查询   科目第一个条件
                        var FK_TSIDArr = $('#FK_TSIDTree').combotree('getValues');
                        if(FK_TSIDArr.length>0){
                         if(TA_statusVal=="" || TA_statusVal.length==0 || TA_statusVal=="undefined"){
                            $.messager.alert('操作提示', '请选择状态!', 'warning');
                            return false;
                         }
                        FK_TSIDTree="TS_titleTree&"+FK_TSIDArr.join(",")+"^";
                        }
                        search=FK_TSIDTree+search;
                        //科目第二个条件
                      var FK_TSIDTreeTwoArr= $('#FK_TSIDTreeTwo').combotree('getValues');

                        if(FK_TSIDTreeTwoArr.length>0){
                         if(TA_statusTwoVal=="" || TA_statusTwoVal.length==0 || TA_statusTwoVal=="undefined"){
                            $.messager.alert('操作提示', '请选择状态!', 'warning');
                            return false;
                         }
                        FK_TSIDTreeTwo="TS_titleTreeTwo&"+FK_TSIDTreeTwoArr.join(",")+"^";
                        }
                       search=FK_TSIDTreeTwo+search;
                        search=search+"FK_DIC_Start&noway^" 
                        $('#flexigridData').datagrid('reload', { search: "FK_TEID&2018011915500544030930c5add34d5^"+search,id:'2018011915500544030930c5add34d5'});
                    }
                },
                     {
                         text: '取消',
                         iconCls: 'icon-cancel',
                         handler: function () {
                             $('#divQuery').dialog("close");
                         }
                     }]
            });
            $('#divQuery').dialog("open");
        };

        
        function isSubmitZx(){
                    var bb=0;
            $.ajax({type:"POST",async:false,cache:false,url:"../../../T_ExamPlaces/isSubmitZx",data:"ksid=2018011915500544030930c5add34d5",success:function(res){
                //alert(res);
                bb=res;
            }});
            return bb;
        }


        //“选择”按钮，在其他（与此页面有关联）的页面中，此页面以弹出框的形式出现，选择页面中的数据
        function flexiSelect() {
            var rows = $('#yesflexigridData').datagrid('getSelections');
            if (rows.length == 0) {
                $.messager.alert('操作提示', '请选择数据!', 'warning');
                return false;
            }

//            if(isSubmitZx()==2)
//            {
//                $.messager.alert('操作提示', '未分配名额，请联系总校分配名额!', 'warning');
//                return false;
//            }

//            if(isSubmitZx()==1)
//            {
//                $.messager.alert('操作提示', '已经提交总校，不能提交报考!', 'warning');
//                return false;
//            }

            //alert(isminge(0,rows.length));
            var stuids=[];
            for(var i=0;i<rows.length;i++){
                stuids.push(rows[i].PK_ID);
                if(isbaokao(rows[i].PK_ID)>0){
                    
                    $.messager.alert('操作提示', '您选择的学员已经参加报考，请重新选择！', 'warning');
                    $("#yesflexigridData").datagrid("reload");
                    $("#yesflexigridData").datagrid("clearSelections");
                    return false; 
                }
            }

//            if(isminge(0,rows.length)<0)
//            {
//                $.messager.alert('操作提示', '系统提示：总名额已满！', 'warning');
//                return false;
//            }
//            else
//            {
             


                 //判断未交补考费和违约金的学员
            //alert(stuids.join(','));
//            $.ajax({type:"POST",async:false,cache:false,url:"../../../S_COST_LIST/isbukaofei",data:"stuids=" + stuids.join(',') + "&kmid=201301301444110156250c451035ec5",success:function(res){
//            //alert(res);
//            //bb=res;
//            var ress=res.split("||");
//            if(ress[0]!="")
//            {
//                $.messager.alert('操作提示', '学员:“' + ress[0] + ress[1], 'warning');
//                return false; 
//            }
//            else
//            {
                $('#wBeizhu').dialog("open");
//            }
//        }});


//            }

            
        }
        //判断报考名额 0全部学员  1计划学员  2备用名额
        function isminge(type,rows){
        var bb=0;
        $.ajax({type:"POST",async:false,cache:false,url:"../../../T_apply/isminge",data:"teid=2018011915500544030930c5add34d5&rows=" + rows + "&type=" + type,success:function(res){
            //alert(res);
            bb=res;
        }});
        return bb;
    }

    //判断该学员在本次考试中已经报考
    function isbaokao(sid){
                var bb=0;
        $.ajax({type:"POST",async:false,cache:false,url:"../../../T_apply/isbaokao",data:"teid=2018011915500544030930c5add34d5&sid=" + sid,success:function(res){
            //alert(res);
            bb=res;
        }});
        return bb;
    }

    function qrcj()
    {
        parent.addTab("确认成绩：2018年第一批", "../../T_apply/SelStudent1/2018011915500544030930c5add34d5", "tu1001", true);
    }



    //提交报考
    function TiJiaoStu(){
        var minge = $("input[name='minge']:checked").val();
        var rows = $('#yesflexigridData').datagrid('getSelections');//学员列表

        //var rows1 = $('#empList').datagrid('getSelections');//教练列表
        

//        if (minge == undefined) {
//            $.messager.alert('操作提示', '请选择名额类型!', 'warning');
//            return false;
//        }
//        if(isminge(1,rows.length)<0 && minge=="0")
//        {
//            $.messager.alert('操作提示', '计划名额已满!', 'warning');
//            return false;
//        }
//        
//        if(isminge(2,rows.length)<0 && minge=="1")
//        {
//            $.messager.alert('操作提示', '备用名额已满!', 'warning');
//            return false;
//        }

//        if (rows1.length == 0) {
//            $.messager.alert('操作提示', '请选择教练!', 'warning');
//            return false;
//        }
        
        var arr = [];
        for (var i = 0; i < rows.length; i++) {

            if(isbaokao(rows[i].PK_ID)>0){
                    
            $.messager.alert('操作提示', '您选择的学员已经参加报考，请重新选择！', 'warning');
            $("#yesflexigridData").datagrid("reload");
            $("#yesflexigridData").datagrid("clearSelections");
            $('#wBeizhu').dialog("close");
            return false; 
        }


            arr.push(rows[i].PK_ID);
        }

        $.messager.confirm('操作提示', "确认提交这 " + arr.length + " 项吗？", function (r)
        {
            if (r) {
                 $.post("../../T_apply/TiJiaoStu", { query: arr.join(","),ksid:'2018011915500544030930c5add34d5',minge:minge,kemu:'201301301444110156250c451035ec5'}, function (res) {
                      if (res == "OK") {    
                      getshumu();
                      getYtjshumu();            
                            $("#SetStudentflexigridData").datagrid("reload");
                            $("#SetStudentflexigridData").datagrid("clearSelections");
                            $("#yesflexigridData").datagrid("reload");
                            $("#yesflexigridData").datagrid("clearSelections");
                            $.messager.alert('操作提示', '操作成功!', 'info');
                            $('#wBeizhu').dialog("close");
                            document.getElementById("iframe").src="../SelStudent1/2018011915500544030930c5add34d5"
                            }
                            else {
                                            //$("#SetStudentflexigridData").datagrid("reload");
                                            //$("#SetStudentflexigridData").datagrid("clearSelections");
                                                //$("#yesflexigridData").datagrid("reload");
                                                //$("#yesflexigridData").datagrid("clearSelections");
                                            $.messager.alert('操作提示', res, 'warning');
                            }
                                });

            }     
         });
    }

                    //直接通过本次考试
    function ZhiJieTongGuo() { 
     var rows = $('#yesflexigridData').datagrid('getSelections');//学员列表
     if (rows.length == 0) {
                $.messager.alert('操作提示', '请选择数据!', 'warning');
                return false;
            }
            var arr=[];
            for(var i=0;i<rows.length;i++){
                arr.push(rows[i].PK_ID);
            }
    
    $.messager.confirm('操作提示', "确认通过这 " + arr.length + " 项吗？", function (r)
        {
            if (r) {
                 $.post("../../T_apply/ZhijieTongguo", { query: arr.join(","),kemu:'201301301444110156250c451035ec5'}, function (res) {
                      if (res == "OK") {        
                            $("#yesflexigridData").datagrid("reload");
                            $("#yesflexigridData").datagrid("clearSelections");
                            $.messager.alert('操作提示', '操作成功!', 'info');
                            }
                            else {

                                            $.messager.alert('操作提示', res, 'warning');
                            }
                                });

            }     
         });

    }

        function querenTijiao(){
            var rows = $('#yesflexigridData').datagrid('getSelections');
            if (rows.length == 0) {
                $.messager.alert('操作提示', '请选择数据!', 'warning');
                return false;
            }
            var arr = [];
            for (var i = 0; i < rows.length; i++) {
                arr.push(rows[i].PK_ID);
            }

            $.messager.confirm('操作提示', "确认提交这 " + arr.length + " 项吗？", function (r)
             {
                if (r) {
               var TE_num=0;
//                if(rows.length>TE_num){
//                  $.messager.alert('操作提示', '选择的人数已经超出已设定的人数('+TE_num+")人", 'warning');
//                 return false;
//                }

              
                                $.post("/T_apply/flexiSelect", { query: arr.join(","),FK_TEID:'2018011915500544030930c5add34d5',TS_amount:reValue }, function (res) {
                                            if (res == "OK") {
                     
                         
                                                 $("#SetStudentflexigridData").datagrid("reload");
                                                 $("#SetStudentflexigridData").datagrid("clearSelections");
                                                 $("#flexigridData").datagrid("reload");
                                                 $("#flexigridData").datagrid("clearSelections");
                                                  $.messager.alert('操作提示', '选择成功!', 'info');
                            
                                            }
                                            else {
                                                        if (res == "") {
                                                            $.messager.alert('操作提示', '选择失败!请查看该数据与其他模块下的信息的关联，或联系管理员。', 'info');
                                                        }
                                                        else {
                                                            $("#SetStudentflexigridData").datagrid("reload");
                                                            $("#SetStudentflexigridData").datagrid("clearSelections");
                                                             $("#flexigridData").datagrid("reload");
                                                             $("#flexigridData").datagrid("clearSelections");
                                                            $.messager.alert('操作提示', res, 'info');
                                                        }
                                            }
                                });
                     }
            });


        }


        //导航到查看详细的按钮
        function getView() {

            var arr = $('#flexigridData').datagrid('getSelections');

            if (arr.length == 1) {
                window.location.href = "../S_Student/Details/" + arr[0].PK_ID;
               
            } else {
                $.messager.alert('操作提示', '请选择一条数据!', 'warning');
            }
            return false;
        }
    

    </script>
    <script type="text/javascript" language="javascript">

    function linshiList(obj){
        //alert(obj);
        var search = "";
        var toolbar = [];
        if(obj=="SetStudentflexigridData"){
            search = 'FK_TEID&2018011915500544030930c5add34d5^ta_fenxiao&2014033114432090614426dd681c9f6^ta_stateStart_Int&3^ta_stateEnd_Int&9^';

            toolbar = "#tb_yitijiao";
        }
//        if(obj=="BaokaoflexigridData"){
//            search = 'FK_TEID&2018011915500544030930c5add34d5^ta_stateStart_Int&5^ta_stateEnd_Int&8^ta_fenxiao&2014033114432090614426dd681c9f6^';

//            toolbar = [{
//                text: '查询',
//                iconCls: 'icon-search',
//                handler: function () {
//                    SelflexiQuery();
//                }
//            }];
//        }
        $('#' + obj).datagrid({
            //title: '待考学员列表', //列表的标题
            iconCls: 'icon-site',
            width: 'auto',
            height: 'auto',
            nowrap: true,
            striped: true,
            collapsible: true,
            url: '../../T_apply/GetData', //获取数据的url
            queryParams: { search: search },
            sortName: 'PK_ID',
            sortOrder: 'desc',
            idField: 'PK_ID',

            toolbar: toolbar,
            columns: [[

                   { field: 'ck', checkbox: true }
                  , { field: 'S_NO', title: '学员编号', width: 60, sortable: true }
                  , { field: 'FK_SSID', title: '学员', width: 60, sortable: true }
                   , { field: 'S_Carmodels', title: '准驾车型', width: 60, sortable: true }
                  , { field: 'S_cardno', title: '身份证号', width: 135, sortable: true }
                   , { field: 'S_tuijianren', title: '推荐人', width: 135, sortable: true }
                  , { field: 'S_zhunkaoCode', title: '准考证号', width: 60, sortable: true }
                  , { field: 'S_mob', title: '手机号', width: 83, sortable: true }
                 , { field: 'ta_fenxiao', title: '报考分校', width: 60, sortable: true }
                  , { field: 'ta_employees', title: '报考教练', width: 60, sortable: true }
                  , { field: 'ta_mingetype', title: '名额类型', width: 60, sortable: true }
                  , { field: 'ta_state', title: '报考状态', width: 60, sortable: true }
                  , { field: 'ks_state', title: '考试状态', width: 60, sortable: true }
                  , { field: 'ks_cishu', title: '次数', width: 30, sortable: true }
            //, { field: 'iszhichu', title: '支出状态', width: 60, sortable: true }
                  , { field: 'S_Remark', title: '备注', width: 200, sortable: true }
                   , { field: 'qianfei', title: '欠费', width: 200, sortable: true }
                  , { field: 'iscanjia', title: '参加状态', width: 60, sortable: true }
                  , { field: 'ks_result', title: '考试结果', width: 60, sortable: true }
                  , { field: 'FK_DIC_from', title: '报名分校', width: 80, sortable: true }
                  , { field: 'S_PhysicalDate', title: '体检日期', width: 75, formatter: function (value, rec) {
                      if (value) {
                          return dateConvert(value);
                      }
                  }
                  }
                ]],
            pagination: true,
            rownumbers: true

        });
    
    }
    $(function () {

        setTimeout(function () { linshiList("SetStudentflexigridData"); }, 1000); //临时提交列表
        setTimeout(function () { getshumu(); }, 2000); //临时提交列表
        //setTimeout(function () { linshiList("BaokaoflexigridData"); }, 2000); //临时提交列表
    });

    //提交总校操作
    function querenBaokao() {
//        var rows = $('#SetStudentflexigridData').datagrid('getSelections');
//        if (rows.length == 0) {
//            $.messager.alert('操作提示', '请选择数据!', 'warning');
//            return false;
//        }

//        var arr = [];
//        for (var i = 0; i < rows.length; i++) {
//            arr.push(rows[i].PK_ID);
//        }

//        if (isSubmitZx() == 1) {
//            $.messager.alert('操作提示', '报考已经提交总校!', 'warning');
//            return false;
//        }

        $.messager.confirm('操作提示', "确认报考后不能再进行提交报考和取消报考，请核对无误后再确认？", function (r) {
            if (r) {
                $.post("../../T_ExamPlaces/tijiaozongxiao", { ksid: '2018011915500544030930c5add34d5' }, function (res) {
                    if (res == "OK") {
                        //移除删除的数据
                        $.messager.alert('操作提示', '提交总校成功!', 'info');
                    }
                    else {
                        $.messager.alert('操作提示', res, 'info');
                    }
                });
            }
        });
    }


    //获取计划数，备用数
    function getshumu() {
        $.post("../../T_apply/getshumu", { ksid: '2018011915500544030930c5add34d5' }, function (res) {
            //alert($("#jihua1").text());
            var ress = [];
            ress = res.split(',');
//            $("#jihua1").text(ress[0]);
//            $("#jihua2").text(ress[1]);
//            $("#beiyong1").text(ress[2]);
//            $("#beiyong2").text(ress[3]);
        });
    }


         //取消报考
         function SelflexiDelete() {

             var rows = $('#SetStudentflexigridData').datagrid('getSelections');
             if (rows.length == 0) {
                 $.messager.alert('操作提示', '请选择数据!', 'warning');
                 return false;
             }

//             if (isSubmitZx() == 1) {
//                 $.messager.alert('操作提示', '已经提交总校，不能取消报考!', 'warning');
//                 return false;
//             }

             var arr = [];
             for (var i = 0; i < rows.length; i++) {
                 arr.push(rows[i].PK_ID);
             }

             $.messager.confirm('操作提示', "确认取消这 " + arr.length + " 项吗？", function (r) {
                 if (r) {
                     $.post("../../T_apply/cannelBaoKao", { query: arr.join(",") }, function (res) {
                         if (res == "OK") {
                             //移除删除的数据
                             getshumu();
                             getYtjshumu()
                             $.messager.alert('操作提示', '取消成功!', 'info');
                             $("#SetStudentflexigridData").datagrid("reload");
                             $("#SetStudentflexigridData").datagrid("clearSelections");
                             $("#yesflexigridData").datagrid("reload");
                             $("#yesflexigridData").datagrid("clearSelections");
                         }
                         else {
                                 $.messager.alert('操作提示', res, 'info');
                         }
                     });
                 }
             });

         };

    </script>


    <script type="text/javascript" language="javascript">
        function SendSms(str) {

            
            if (str == "1") { obj = $('#SetStudentflexigridData'); }
            var rows = obj.datagrid('getSelections');
            //alert(rows.length);
            if (rows.length == 0) {
                $.messager.alert('操作提示', '请选择数据!', 'warning');
                return false;
            }

            var arr = [];
            var search = "";
            for (var i = 0; i < rows.length; i++) {
                arr.push(rows[i].PK_ID);
                search = search + " it.PK_ID='" + arr[i] + "' or "
            }
            //alert(arr[0]);
            search = search + "1=2"
            //alert(search);
            //获取短信编号
            $.post("../../../D_Sms/GetSmsCode", function (res) {
                //alert(res);

                $("#DS_code").html(res);
            });
            //获取短信编号

            //alert(search);
            //将待发送列表装载到确认发送列表
            //执行查询
            $(function () {

                $('#querenfasong').datagrid({
                    width: '404',
                    height: '231',
                    nowrap: false,
                    striped: true,
                    collapsible: true,
                    url: '../../../T_apply/GetDataNoPage', //获取数据的url
                    queryParams: { search: search },
                    sortName: 'PK_ID',
                    sortOrder: 'asc',
                    idField: 'PK_ID',
                    toolbar: [

                   {
                       text: '删除',
                       iconCls: 'icon-ok',
                       handler: function () {
                           return fasongDelete();
                       }
                   }],
                    columns: [[
                   { field: 'S_NO', title: '学员编号', width: 80 }
                   , { field: 'FK_SSID', title: '学员姓名', width: 120 }
                   , { field: 'S_mob', title: '手机号', width: 136 }
                ]],
                    pagination: false,
                    rownumbers: false
                });

            });
            $("#DS_title").val("关于" + rows[0].FK_TEID + "报名情况的通知 (2018/1/23)。");
            var $win;
            $win = $('#test-window');
            $win.window('open');
        }

        //删除的按钮
        function fasongDelete() {
            var rows = $('#querenfasong').datagrid('getSelections');
            var arr = [];
            if (rows.length == 0) {
                $.messager.alert('操作提示', '请选择数据!', 'warning');
                return false;
            }
            $.messager.confirm('操作提示', "确认删除这 " + rows.length + " 项吗？", function (r) {

                for (var i = rows.length - 1; i >= 0; i--) {
                    var index = $('#querenfasong').datagrid('getRowIndex', rows[i]); //获取某行的行号
                    $('#querenfasong').datagrid('deleteRow', index); //通过行号移除该行
                }

            });

        }
        //取消发送 关闭
        function cannelSend() {
            $('#test-window').window('close', true);
        }
        //确认发送短信
        function querenfasong() {
            var title = $("#DS_title").val();
            var SsContent = $("#DS_content").val();
            if (title == "") {
                $.messager.alert('操作提示', '请输入短信标题!', 'warning');
                return false;
            }
            if (SsContent == "") {
                $.messager.alert('操作提示', '请输入短信内容!', 'warning');
                return false;
            }
            $.messager.confirm('操作提示', "确认要发送吗？", function (r) {
                var rows = $('#querenfasong').datagrid('getRows');
                var arr = [], pkid = [], sno = [];
                for (var i = 0; i < rows.length; i++) {
                    arr.push(rows[i].S_mob); //学员手机
                    sno.push(rows[i].S_NO); //学员编号
                    pkid.push(rows[i].PK_ID); //考试报名ID
                }
                //alert(pkid[0]);
                if (r) {
                    $.post("../../../D_Sms/SengSmsAndSmsAdd", { query: arr.join(";"), sno: sno.join(";"), pkids: pkid.join(","), title: title, SsContent: SsContent }, function (res) {
                        //alert(res);
                        $.messager.alert('操作提示', res, 'warning');
                        $("#DS_title").val("");
                        $("#DS_content").val("");
                        cannelSend();
                    });
                }
            });

        }

        //获取回复短信
        function getReply() {
            $.messager.confirm('操作提示', "确认要获取吗？", function (r) {
                if (r) {
                    $.post("../../../D_Reply/getReply", function (res) {
                        var ress = res.split("||");
                        if (ress[0] == "OK") {
                            //移除删除的数据
                            $.messager.alert('操作提示', ress[1], 'info');
                            $("#SetStudentflexigridData").datagrid("reload");
                            $("#SetStudentflexigridData").datagrid("clearSelections");
                        }
                        else {
                            $.messager.alert('操作提示', ress[1], 'info');
                        }
                    });
                }
            });
        }
        //确认发送短信

                        //查询
        function ybkFindData() {
            search1 = 'FK_TEID&2018011915500544030930c5add34d5^ta_fenxiao&2014033114432090614426dd681c9f6^ta_stateStart_Int&3^ta_stateEnd_Int&9^';

            var searchType = $("#searchType").combobox("getValue"); //查询条件
            var wordvalue = $("#wordvalue").val();
            //alert(wordvalue);
            //var fenxiao = $("#" + str + "fenxiao").combobox("getValue"); //分校
            if (wordvalue != "") {
                search1 += searchType + "&" + wordvalue + "^"
            }

            var CarModels = $("#CarModels").combobox("getValue"); //准驾车型
            if (CarModels != "") {
                search1 += "S_Carmodels&" + CarModels + "^"
            }
           

            //var ybk_fenxiao = $("#ybk_fenxiao").combobox("getValue");
            //if (ybk_fenxiao != "") {
                //search += "ta_fenxiao&" + ybk_fenxiao + "^";
            //}

            //alert(search);

            var ybk_state = $("#ybk_state").combobox("getValue");
            if (ybk_state != "") {
                search1 += "ta_state1&" + ybk_state + "^";
            }
            
            var iszhichu = $("#iszhichu").combobox("getValue");
            if (iszhichu != "") {
                search1 += "iszhichuStart_Int&" + iszhichu + "^iszhichuEnd_Int&" + iszhichu + "^";
            }
//            alert(iszhichu);
//            var ks_result = $("#ks_result").combobox("getValue");
//            if (ks_result != "") {
//                search += "ks_resultStart_Int&" + ks_result + "^ks_resultEnd_Int&" + ks_result + "^";
//            }


//            $('#tb').find(":text,:selected,select,textarea,:hidden,:checked,:password").each(function () {
//                search = search + this.id + "&" + this.value + "^";
//            });
            //执行查询
            //alert(search);

            $('#SetStudentflexigridData').datagrid('reload', { search: search1 });
        }
        


        //内部学员查询
        function FindData(str) {
            var search = '';
            var kmid = '201301301444110156250c451035ec5';
            var km = '1';
            if (kmid == "20130130173022453125039df785212") {
                km = '2';
            }
            if (kmid == "201303011352109531250c061f1b805") {
                km = '3';
            }
            if (kmid == "20130301135250515625081e946c869") {
                km = '4';
            }
            var wordvalue = document.getElementById(str + "wordvalue").value; //关键字

            //var S_regdateStart_Time = document.getElementById(str + "S_regdateStart_Time").value; //关键字
            //var S_regdateEnd_Time = document.getElementById(str + "S_regdateEnd_Time").value; //关键字

            var searchType = $("#" + str + "searchType").combobox("getValue"); //查询条件


            //var fenxiao = $("#" + str + "fenxiao").combobox("getValue"); //分校

//            var S_baokaozhidui = $("#" + str + "S_baokaozhidui").combobox("getValue"); 
//            var S_guanliyuan = $("#" + str + "S_guanliyuan").combobox("getValue");

//            if (S_baokaozhidui != "") {
//                search += "S_baokaozhidui&" + S_baokaozhidui + "^";
//            }
//            if (S_guanliyuan != "") {
//                search += "S_guanliyuan&" + S_guanliyuan + "^";
//            }

            if (wordvalue != "") {
                search += searchType + "&" + wordvalue + "^"
            }

//            if (fenxiao != "") {
//                search += "FK_DIC_from&" + fenxiao + "^"
//            }

            var CarModels = $("#" + str + "CarModels").combobox("getValue"); //准驾车型
            if (CarModels != "") {
                search += "S_Carmodels&" + CarModels + "^"
            }

            var fenxiaoID = $("#" + str + "fenxiaoID").combobox("getValue"); //准驾车型
            if (fenxiaoID != "") {
                search += "FK_DIC_from&" + fenxiaoID + "^"
            }

            var fendianID = $("#" + str + "fendianID").combobox("getValue"); //准驾车型
            if (fendianID != "") {
                search += "FenXiaoBuMenId&" + fendianID + "^"
            }

            var S_SubState = $("#" + str + "S_SubState").combobox("getValue");
            if (S_SubState != "") {
                search += "S_Sub" + km + "StateStart_Int&" + S_SubState + "^S_Sub" + km + "StateEnd_Int&" + S_SubState + "^"
            }

            if (str == "yes") {
                search += 'S_Sub1BaoKaoStart_Int&0^S_Sub1BaoKaoEnd_Int&2^S_ZhiDuiShouLiStart_Int&1^S_ZhiDuiShouLiEnd_Int&1^S_FinanAuditStart_Int&0^S_FinanAuditEnd_Int&0^S_SubjectAhours&2013052917005326562506357515b2e^FK_DIC_Start&noway^||201301301444110156250c451035ec5$$yes';
            }
            else {
                search += 'S_Sub1BaoKaoStart_Int&0^S_Sub1BaoKaoEnd_Int&2^FK_DIC_Start&noway^||201301301444110156250c451035ec5$$no';
            }

            //执行查询
            //alert(search);
            $('#' + str + 'flexigridData').datagrid('reload', { search: search + "allstu" });
        }

        function flexiArchives(str) {
            //alert(str);
            var rows = $('#' + str + 'flexigridData').datagrid('getSelections');
            if (rows.length != 1) {
                $.messager.alert('操作提示', '请选择一条数据!', 'warning');
                return false;
            }
            parent.addTab("档案:" + rows[0].S_name, "../../S_Archives/IndexNew/" + rows[0].PK_ID + "?rd=" + Math.random(), "tu1001", true, rows[0].PK_ID);
        }

        function progress() {
            var win = $.messager.progress({
                title: '请等待',
                text: '数据正在处理中'
            });
        }

        //已报考查询
        var search1 = 'FK_TEID&2018011915500544030930c5add34d5^ta_fenxiao&2014033114432090614426dd681c9f6^ta_stateStart_Int&3^ta_stateEnd_Int&9^';
        //“导出”按钮     在6.0版本中修改
        function ExportYibaokao() {
            $.messager.confirm('操作提示', "确认要导出到EXCEL！", function (r) {

                if (r) {
                    progress();

                    var p = $('#SetStudentflexigridData').datagrid('options').columns[0];
                    var field = []; //所有的列名
                    var title = []; //所有的标题名称
                    $(p).each(function () {
                        if (this.title != null) {
                            field.push(this.field);
                            title.push(this.title);
                        }

                    });
                    var titlestr = removeHTMLTag(title.join(","))
                    //alert(title.join(','));
                    $.post("../../T_apply/ExportYibaokao",
                {
                    title: titlestr,
                    field: field.join(","),
                    sortName: $('#SetStudentflexigridData').datagrid('options').sortName,
                    sortOrder: $('#SetStudentflexigridData').datagrid('options').sortOrder,
                    search: search1
                }, function (res) {
                    $.messager.progress('close');
                    window.location.href = res;

                });
                } 
            });


    };

    //“导出”按钮     在6.0版本中修改
    function Exportdaibaokao(str) {
        $.messager.confirm('操作提示', "确认要导出到EXCEL！", function (r) {

            if (r) {
                progress();
                var search = '';
                var kmid = '201301301444110156250c451035ec5';
                var km = '1';
                if (kmid == "20130130173022453125039df785212") {
                    km = '2';
                }
                if (kmid == "201303011352109531250c061f1b805") {
                    km = '3';
                }
                if (kmid == "20130301135250515625081e946c869") {
                    km = '4';
                }
                var wordvalue = document.getElementById(str + "wordvalue").value; //关键字

                var searchType = $("#" + str + "searchType").combobox("getValue"); //查询条件

                if (wordvalue != "") {
                    search += searchType + "&" + wordvalue + "^"
                }

                var CarModels = $("#" + str + "CarModels").combobox("getValue"); //准驾车型
                if (CarModels != "") {
                    search += "S_Carmodels&" + CarModels + "^"
                }

                var fenxiaoID = $("#" + str + "fenxiaoID").combobox("getValue"); //准驾车型
                if (fenxiaoID != "") {
                    search += "FK_DIC_from&" + fenxiaoID + "^"
                }

                var fendianID = $("#" + str + "fendianID").combobox("getValue"); //准驾车型
                if (fendianID != "") {
                    search += "FenXiaoBuMenId&" + fendianID + "^"
                }

                var S_SubState = $("#" + str + "S_SubState").combobox("getValue");
                if (S_SubState != "") {
                    search += "S_Sub" + km + "StateStart_Int&" + S_SubState + "^S_Sub" + km + "StateEnd_Int&" + S_SubState + "^"
                }


                if (str == "yes") {
                    search += 'S_Sub1BaoKaoStart_Int&0^S_Sub1BaoKaoEnd_Int&2^S_ZhiDuiShouLiStart_Int&1^S_ZhiDuiShouLiEnd_Int&1^S_FinanAuditStart_Int&0^S_FinanAuditEnd_Int&0^S_SubjectAhours&2013052917005326562506357515b2e^FK_DIC_Start&noway^||201301301444110156250c451035ec5$$yes';
                }
                else {
                    search += 'S_Sub1BaoKaoStart_Int&0^S_Sub1BaoKaoEnd_Int&2^FK_DIC_Start&noway^||201301301444110156250c451035ec5$$no';
                }
                var p = $('#' + str + 'flexigridData').datagrid('options').columns[0];
                var field = []; //所有的列名
                var title = []; //所有的标题名称
                $(p).each(function () {
                    if (this.title != null) {
                        field.push(this.field);
                        title.push(this.title);
                    }

                });
                var titlestr = removeHTMLTag(title.join(","))
                //alert(title.join(','));
                $.post("../../S_Student/Exportdaibaokao",
                {
                    title: titlestr,
                    field: field.join(","),
                    sortName: $('#' + str + 'flexigridData').datagrid('options').sortName,
                    sortOrder: $('#' + str + 'flexigridData').datagrid('options').sortOrder,
                    search: search + "allstu"
                }, function (res) {
                    $.messager.progress('close');
                    window.location.href = res;

                });
            }
        });


    };


        function showUpFile() {

            $('#upfile').dialog("open");
        };
        function UpFile() {
            var file = document.getElementById('fileUp').value
            //   var search='S_Sub1BaoKaoStart_Int&0^S_Sub1BaoKaoEnd_Int&2^S_ZhiDuiShouLiStart_Int&1^S_ZhiDuiShouLiEnd_Int&1^S_FinanAuditStart_Int&0^S_FinanAuditEnd_Int&0^S_SubjectAhours&2013052917005326562506357515b2e^FK_DIC_Start&noway^||201301301444110156250c451035ec5$$yes';
//            var isCreatCost = $("input[name='isCreatCostList']:checked").val();
//            if (isCreatCost == undefined || isCreatCost == null) {
//                alert("请选择导入类型！！！");
//                return false;
//            }
            var search = 'S_Sub1BaoKaoStart_Int&0^S_Sub1BaoKaoEnd_Int&2^S_ZhiDuiShouLiStart_Int&1^S_ZhiDuiShouLiEnd_Int&1^S_FinanAuditStart_Int&0^S_FinanAuditEnd_Int&0^S_SubjectAhours&2013052917005326562506357515b2e^FK_DIC_Start&noway^||201301301444110156250c451035ec5$$yes'
            var tempStr = "";
            var shenfenzheng = "";
            var kaoshichengji = "";
            var koashishijian = "";
            var filePath = file;
            var istrue = lastname(file);
            if (istrue) {
                var oXL = new ActiveXObject("Excel.application");

                var oWB = oXL.Workbooks.open(filePath);
                oWB.worksheets(1).select();

                var oSheet = oWB.ActiveSheet;
                var colcount = oSheet.UsedRange.Cells.Rows.Count; //获取数据行数
                //   var colcolumn = oWB.Worksheets(1).UsedRange.Columns.Count; 获取工作表数量

                try {
                //查询导入
                    //if (isCreatCost=="chaxun") {
                        for (var i = 2; i <= colcount; i++) {
                            if (oSheet.Cells(i, 1).value == "null")
                                break;
                            var a = oSheet.Cells(i, 1).value.toString() == "undefined" ? "" : oSheet.Cells(i, 1).value;
                            tempStr += ("'"+a +"',");
                        }
                    //}
//                 //成绩导入
//                    if (isCreatCost == "chengji") {
//                        for (var i = 3; i <= colcount; i++) {
//                            if (oSheet.Cells(i, 1).value == "null" || oSheet.Cells(i, 2).value == "null" || oSheet.Cells(i, 3).value == "null")
//                                break;
//                            alert(colcount);
//                            var a = oSheet.Cells(i, 1).value;
//                            alert(a);
//                            var b = oSheet.Cells(i, 2).value;
//                            alert(b);
//                            var c = oSheet.Cells(i, 3).value;
//                            alert(c);
//                            shenfenzheng += (a + ",");
//                            kaoshichengji += (b + ",");
//                            koashishijian += (c + ",");
//                        }
//                    }
                    
                } catch (e) {


                }
                //  document.all.txtArea.value = tempStr;
                oXL.Quit();
                CollectGarbage();
               
                //成绩导入
//                if (isCreatCost == "chengji") {
//                    progress();
//                    alert(kaoshichengji);
//                    shenfenzheng = shenfenzheng.substring(0, shenfenzheng.length - 1);
//                    kaoshichengji = kaoshichengji.substring(0, kaoshichengji.length - 1);
//                    koashishijian = koashishijian.substring(0, koashishijian.length - 1);
//                        $.post("../../T_apply/excelchengjiadd", { shenfenzheng: shenfenzheng, kaoshichengji: kaoshichengji, koashishijian: koashishijian }, function (res) {
//                            //alert(res);
//                            $.messager.alert('操作提示', res, 'warning');
//                            $('#upfile').dialog("close");
//                            $('#yesflexigridData').datagrid('reload', { search: search + "allstu" }); 
//                            $.messager.progress('close');
//                        });
//                }

                //查询导入
                //if (isCreatCost == "chaxun") {
                if (tempStr != "" || tempStr != null || tempStr != undefined) {
                    progress();
                    tempStr = tempStr.substring(0, tempStr.length - 1);
                    search = "daorusfz&" + tempStr + "^" + search;
                    $('#upfile').dialog("close");
                    $.post("../../T_apply/getcuowu", { tempStr: tempStr, search: search + "allstu" }, function (res) {
                        document.getElementById("Divvvv").innerHTML = res;
                        $('#Divvv').dialog("open");
                        $.messager.alert('操作提示', '操作成功!');
                        $('#yesflexigridData').datagrid('reload', { search: search + "allstu" });
                        $.messager.progress('close');
                    });
                }
                //}

            }
        };
        function lastname(filepath) {
            //获取欲上传的文件路径

            if (filepath == null || filepath == undefined || filepath == "") {
                alert("请选择要上传的数据模板");
                return false;
            }
            //为了避免转义反斜杠出问题，这里将对其进行转换
            var re = /(\\+)/g;
            var filename = filepath.replace(re, "#");
            //对路径字符串进行剪切截取
            var one = filename.split("#");
            //获取数组中最后一个，即文件名
            var two = one[one.length - 1];
            //再对文件名进行截取，以取得后缀名
            var three = two.split(".");
            //获取截取的最后一个字符串，即为后缀名
            var last = three[three.length - 1];
            //添加需要判断的后缀名类型
            var tp = "xls,xlsx,XLS,XLSX";
            //返回符合条件的后缀名在字符串中的位置
            var rs = tp.indexOf(last);
            //如果返回的结果大于或等于0，说明包含允许上传的文件类型
            if (rs >= 0) {
                return true;
            } else {
                alert("您选择的上传文件不是有效的EXCEL文件！");
                return false;
            }
        }
    </script>   
          <!--发送短信-->
        <link href="/Content/StyleSheet.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    .editor-label{ width:80px;}
    .editor-field,.textarea-box{ padding-left:0px; margin-left:0px; margin-top:8px;}
    </style>
    <style type="text/css">
<!--

.easyui-dialog .input .editor-label-search
{
	width:60px;
}
.easyui-dialog .input .editor-field-search
{
	width:115px;
}
	
.easyui-dialog	.editor-field-to
	{
		width:230px;
		text-align:left;
	}
-->
</style>

      <base target = "_self">
</head>
<body>
    

    <div class="easyui-layout" style="width:100%;margin:5px;" fit="true">  
 
 
        <div data-options="region:'west',split:true" title="2018年第一批" >  
            <div class="easyui-accordion" data-options="fit:true,border:false">  
                <div title="符合报考条件学员" data-options="selected:true" style="padding:5px;">  
                    <table id="yesflexigridData" fit="true"></table>
                </div>  
                <div title="不符合报考条件学员" style="padding:5px;">  
                    <table id="noflexigridData" fit="true"></table>
                </div>   
            </div>  
        </div>  
         
    </div> 
    <!--发送短信-->

        <div id="test-window" class="easyui-window" title="发送信息" minimizable="false" collapsible="false" closed="true" modal="true" style="width: 600px; height: 520px;">
        <div style="padding: 5px; padding-top:0px; text-align: center;">

                <fieldset style=" width:542px; padding-bottom:10px;">
        <legend>
            <input class="submitcss" type="button" id="fasong" onclick="querenfasong();" value="确认发送" />
            <input class="submitcss" type="button" onclick="cannelSend();" value="取消发送" />
        </legend>
        <div class="bigdiv">
            <div style="width:113px; float:left; height:25px;">
                <label for="DS_code">短信编号</label>
            </div>
            <div style="width:400px; float:left; text-align:left;height:25px; font-weight:bold;">
                <span id="DS_code"></span>
            </div>
            <div class="editor-label">
                <label for="DS_title">短信标题</label>
            </div>
            <div class="textarea-box">
                <input class="text-box single-line" data-val="true" data-val-length="长度不可超过200" data-val-length-max="200" style="width:400px;" id="DS_title" name="DS_title" type="text" value="" />
                <span class="field-validation-valid" data-valmsg-for="DS_title" data-valmsg-replace="true"></span>
            </div>
            
            <div class="editor-label">
                <label for="DS_content">短信内容</label>
            </div>
            <div class="textarea-box">
                <textarea cols="20" data-val="true" data-val-length="长度不可超过4000" data-val-length-max="4000" id="DS_content" name="DS_content" rows="2" style="width:400px;">
</textarea>
                <span class="field-validation-valid" data-valmsg-for="DS_content" data-valmsg-replace="true"></span>
            </div>
            <div class="editor-label">
                <label for="DS_title">接 收 人</label>
            </div>
            <div class="textarea-box">
            <div style="width:420px; float:left; margin-left:27px;"><table id="querenfasong"></table></div>
            </div>
        </div>
    </fieldset>
        </div>
        </div>

        <div id="wBeizhu" class="easyui-dialog" title="请选择名额类别" closed="true" style="width:300px;height:120px;padding:10px"
           data-options="
              iconCls: 'icon-save',
                buttons: [{
                    text:'确认提交',
                   iconCls:'icon-ok',
                   handler:function(){
                       TiJiaoStu();
                  }
                },{
                   text:'取消报考',
                    handler:function(){
                       $('#wBeizhu').dialog('close');
                   }
               }]
          ">

          <span>名额类别：</span>
                <span><input type="radio"  value="0" checked="checked" name="minge"/>计划名额</span>
                <span><input " type="radio"  value="1" name="minge"/>备用名额</span><br />

    </div>


    

       <div id="tb_yitijiao" onkeydown="if(event.keyCode==13){ybkFindData()}" style="padding:5px;height:auto">
        <div style="margin-bottom:5px">
            <a href="#" class="easyui-linkbutton" iconCls="icon-remove" onclick='SelflexiDelete();' plain="true">取消提交</a>
            <a href="#" class="easyui-linkbutton" iconCls="icon-excel" onclick='ExportYibaokao();' plain="true">导出EXCEL</a>
             <a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick='SendSms("1");' plain="true">发送短信</a>
            <a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick='getReply();' plain="true">获取回复</a>
            
            
            <div  class="textshu">
            <a href="#" class="easyui-linkbutton" plain="false">[提交报考：<span id="ybkshu"></span>] [成功：<span id="cgshu"></span>] [失败：<span id="sbshu"></span>] [待报考：<span id="dbkshu"></span>]</a>
            <a href="#" class="easyui-linkbutton" plain="false">参加结果：[参加：<span id="cjshu"></span>] [缺考：<span id="qkshu"></span>]</a> 
            
            <span style=" display:none;"><a href="#" class="easyui-linkbutton" plain="false">支出结果：[已支出：<span id="yzcshu"></span>] [未支出：<span id="wzcshu"></span>] [待支出：<span id="dzcshu"></span>]</a></span>        
            <a href="#" class="easyui-linkbutton" plain="false">考试结果：[合格：<span id="hgshu"></span>] [不合格：<span id="bhgshu"></span>]</a>
            </div>
        </div>
        <div>
            查询条件：
            <select class="easyui-combobox" panelHeight="auto" id="searchType" style="width:70px">
                <option value="S_cardno">身份证号</option>
                <option value="S_NO">学员编号</option>
                <option value="S_zhunkaoCode">准考证号</option>
                <option value="S_ArNO">档案编号</option>
                <option value="S_name">学员姓名</option>
                <option value="S_mob">手机号码</option>
           </select>&nbsp;
            关键字: <input class="input-textbox" id="wordvalue" style="width:80px" />
            准驾车型：<select class="easyui-combobox" id="CarModels" name="CarModels" style="width:70px;"><option value="">请选择</option>
<option value="20130819150209578125066d0a9bd68">C1</option>
<option value="201403190851049953614a850002db0">C2</option>
</select> 
            报考状态: 
            <select class="easyui-combobox" panelHeight="auto" id="ybk_state" style="width:60px">
                <option value="">全部</option>
                <option value="9">待报考</option>
                <option value="5">已报考</option>
                <option value="8">报考成功</option>
                <option value="3">报考失败</option>
           </select>
            &nbsp;&nbsp;
            支出状态: 
            <select class="easyui-combobox" panelHeight="auto" id="iszhichu" style="width:60px">
                <option value="">全部</option>
                <option value="0">未支出</option>
                <option value="1">待支出</option>
                <option value="2">已支出</option>
           </select>
           <a href="javascript:void(0);" onclick="ybkFindData();" class="easyui-linkbutton" iconCls="icon-search">查询</a>
        </div>
    </div>
                <!--符合条件学员查询-->
                <div id="yesSearch2" onkeydown="if(event.keyCode==13){FindData('yes')}" style="padding:5px;height:auto; font-size:12px;">
                 <div>
                    <a href="javascript:void(0);" onclick="TiJiaoStu();" class="easyui-linkbutton" iconCls="icon-ok" plain="true">提交报考</a>
                    <a href="javascript:void(0);" onclick="flexiArchives('yes');" class="easyui-linkbutton" iconCls="icon-details" plain="true">学员档案</a>
                    <a href="#" onclick="showUpFile();" class="easyui-linkbutton" iconCls="icon-ok" plain="true">导入Excle</a>
                    <a href="#" onclick="Exportdaibaokao('yes');" class="easyui-linkbutton" iconCls="icon-ok" plain="true">导出Excle</a>
                    <a href="javascript:void(0);" onclick="qrcj();" class="easyui-linkbutton" iconCls="icon-ok" plain="true">确认成绩</a>
                    
                    
                 </div>
        <div>
         查询条件：
            <select class="easyui-combobox" panelHeight="auto" id="yessearchType" style="width:70px">
                <option value="S_cardno">身份证号</option>
                <option value="S_NO">学员编号</option>
                <option value="S_zhunkaoCode">准考证号</option>
                <option value="S_ArNO">档案编号</option>
                <option value="S_name">学员姓名</option>
                <option value="S_mob">手机号码</option>
           </select>&nbsp;
            关键字: <input class="input-textbox" id="yeswordvalue" style="width:80px" />
            准驾车型：<select class="easyui-combobox" id="yesCarModels" name="yesCarModels" style="width:70px;"><option value="">请选择</option>
<option value="20130819150209578125066d0a9bd68">C1</option>
<option value="201403190851049953614a850002db0">C2</option>
</select> 
            考试状态：<select class="easyui-combobox" panelHeight="auto" id="yesS_SubState" style="width:70px">
                <option value="">请选择</option>
                <option value="0">初考</option>
                <option value="1">补考</option>
                <option value="2">缺考</option>
           </select>&nbsp;
            报名分校：<select class="easyui-combobox" id="yesfenxiaoID" name="yesfenxiaoID" style="width:80px;"><option value="">请选择</option>
<option value="2014033114432090614426dd681c9f6">总校</option>
<option value="2018011210134664343439256106478">挂靠</option>
</select>
            &nbsp;报名分点：<select class="easyui-combobox" data-val="true" data-val-length="长度不可超过50" data-val-length-max="50" id="yesfendianID" name="fendianID" style="width:100px;"></select>
            <a href="javascript:void(0);" onclick="FindData('yes');" class="easyui-linkbutton" iconCls="icon-search">查询</a>
            </div>
            </div>

            <!--不符合条件学员查询-->
            <div id="noSearch" onkeydown="if(event.keyCode==13){FindData('no')} style="padding:5px;height:auto; font-size:12px;">
                 <div>
                    
                    <a href="javascript:void(0);" onclick="flexiArchives('no');" class="easyui-linkbutton" iconCls="icon-details" plain="true">学员档案</a>

                 </div>
        <div>
         查询条件：
            <select class="easyui-combobox" panelHeight="auto" id="nosearchType" style="width:70px">
                <option value="S_cardno">身份证号</option>
                <option value="S_NO">学员编号</option>
                <option value="S_zhunkaoCode">准考证号</option>
                <option value="S_ArNO">档案编号</option>
                <option value="S_name">学员姓名</option>
                <option value="S_mob">手机号码</option>
           </select>&nbsp;
            关键字: <input class="input-textbox" id="nowordvalue" style="width:80px" />
            准驾车型：<select class="easyui-combobox" id="noCarModels" name="noCarModels" style="width:70px;"><option value="">请选择</option>
<option value="20130819150209578125066d0a9bd68">C1</option>
<option value="201403190851049953614a850002db0">C2</option>
</select> 
            考试状态：<select class="easyui-combobox" panelHeight="auto" id="noS_SubState" style="width:70px">
                <option value="">请选择</option>
                <option value="0">初考</option>
                <option value="1">补考</option>
                <option value="2">缺考</option>
           </select>&nbsp;
            报名分校：<select class="easyui-combobox" id="nofenxiaoID" name="nofenxiaoID" style="width:80px;"><option value="">请选择</option>
<option value="2014033114432090614426dd681c9f6">总校</option>
<option value="2018011210134664343439256106478">挂靠</option>
</select>
            &nbsp;报名分点：<select class="easyui-combobox" data-val="true" data-val-length="长度不可超过50" data-val-length-max="50" id="nofendianID" name="fendianID" style="width:100px;"></select>
            <a href="javascript:void(0);" onclick="FindData('no');" class="easyui-linkbutton" iconCls="icon-search">查询</a>
            </div>
            </div>
            <div id="upfile" title="文件上传" class="easyui-dialog" closed="true" modal="true"
        iconcls="icon-search" style="width:400px; height:200px; text-align:center;">
        <a href="../../Files/查询模板.xlsx"  class="easyui-linkbutton" iconCls="icon-ok" plain="true">查询模版下载</a>
        
          <p></p><input type="file" id="fileUp" name="fileUp" size="23" />
             <a href="javascript:void(0);" onclick="UpFile();" class="easyui-linkbutton" iconCls="icon-ok">上传</a>
               
     </div>
     <div id="Divvv" title="未导入原因" class="easyui-dialog" closed="true" modal="true"
        iconcls="icon-search" style="width:600px; height:400px; text-align:center;">
        <div id="Divvvv" style="width:585px; height:363px;overflow:auto;text-align:left;"></div>
     </div>

</body>
</html>
